package com.dsg.controller.apply;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsg.common.constants.MessageConstants;
import com.dsg.common.dto.AjaxResult;
import com.dsg.controller.base.BaseController;
import com.dsg.entity.apply.DsgApplyBank;
import com.dsg.service.apply.IDsgApplyBankService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author system
 * @since 2021-08-16
 */
@RestController
@RequestMapping("/apply/dsgApplyBank")
public class DsgApplyBankController extends BaseController {

    @Autowired
    private IDsgApplyBankService service;

    /**
     * 查詢銀行下拉
     *
     * @return
     */
    @GetMapping(value = "/getDropDown")
    @ApiOperation("查詢銀行下拉")
    public AjaxResult getDropDown() {
        QueryWrapper<DsgApplyBank> wrapper = new QueryWrapper<>();
        wrapper.select("BANK_CODE as paraKey,CONCAT(BANK_CODE,' ',BANK_EN,' ',BANK_CN) as paraValue");
        return json(MessageConstants.SSO_STATUS_SUCCESS, service.listMaps(wrapper));
    }
}
